let newArr = [1, 2, 3, 4, 5, 6]
let newArr1 = newArr.find((item) => {
    return item>2
})
//返回符合条件的第一个元素
console.log(newArr1)  //3

let newArr2 = [
    {
        id: 1,
        name: "单色凌",
        age: 23,
        isStar:true
    },
    {
        id: 2,
        name: "徐良",
        age: 21,
        isStar: true
    },
    {
        id: 3,
        name: "汪苏泷",
        isStar: true
    },
    {
        id: 4,
        name: "段嘉许",
        isStar: false
    }
]

let newArr3 = newArr2.find((item) => {
    return item.isStar==false
})
let newArr3Index = newArr2.findIndex((item) => {
    return item.isStar == false
})
console.log(newArr3)  //返回符合条件的第一个数组对象  {  id: 4, name: '段嘉许', isStar: false }
console.log(newArr3Index) //返回符合条件的第一个索引  3